package com.tjbank.cssys.web.controller;

import com.github.pagehelper.PageInfo;
import com.tjbank.cssys.domain.CkErrorLog;
import com.tjbank.cssys.domain.CkLog;
import com.tjbank.cssys.repository.CkErrorLogMapper;
import com.tjbank.cssys.web.service.CkErrorLogService;
import com.tjbank.cssys.web.service.CkLogService;
import com.tjbank.cssys.web.util.CommonResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

@Api(tags = "CkLogController", description = "日志配置")
@RestController
@RequestMapping("/errorlog")
public class CkErrorLogController {

    private  final  static Logger logger = LoggerFactory.getLogger(CkLogController. class);

    @Autowired
    private CkErrorLogService ckErrorLogService;


    @ApiOperation("获取 错误 error日志信息 查询管理")
    @PostMapping("/list")
    public CommonResult selectList(CkErrorLog ckErrorLog , @RequestParam(defaultValue = "1") Integer page, @RequestParam(defaultValue = "5")Integer pageSize,  HttpServletRequest request ){
        PageInfo pageInfo = ckErrorLogService.selectError(ckErrorLog,  page, pageSize, request);
        return CommonResult.success(pageInfo,"查询成功！");
    }


}
